﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="userManager.aspx.cs" Inherits="userManager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户管理</title>
    <link href="css/shipping.css" rel="stylesheet" type="text/css" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/cs.css" rel="stylesheet" type="text/css" />  

    <script type="text/javascript">
    function delConfirm() {
        var msg = "确定要删除吗?";
        return confirm(msg);    
    }    
    
    // 点击复选框时触发事件
    function treeNodeClick() {
        
        var ele = event.srcElement; 
        if(ele.type=='checkbox') {             
            var childrenDivID = ele.id.replace('CheckBox','Nodes'); 
            var div = document.getElementById(childrenDivID); 
            if(div==null) return; 
            var checkBoxs = div.getElementsByTagName('INPUT'); 
            for(var i=0;i<checkBoxs.length;i++) {
                if(checkBoxs[i].type=='checkbox') 
                    checkBoxs[i].checked=ele.checked; 
            } 
        } 
    }    
    </script>

</head>
<body>
    <form id="form1" runat="server">
            <div id="container">
            <!--search condition -->
            <div id="searchBox">
                <span>登录名:</span>
                <asp:TextBox runat="server" ID="TextBoxUserCode" CssClass="inputBox"/>
                <span>名称:</span>
                <asp:TextBox runat="server" ID="TextBoxUserName" CssClass="inputBox"/>               
                <br />
                <div id="action">
                    <asp:Button ID="ButtonQuery" runat="server" OnClick="ButtonQuery_Click" Text="查询"
                        CssClass="button" />
                </div>
            </div>    
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="60%" align="left" valign="top">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="1"
                        CellSpacing="1" BorderWidth="0px" BackColor="#C6D5DC" CssClass="biaoresult" AllowPaging="True"
                        OnPageIndexChanging="GridView1_PageIndexChanging" PageSize="20" OnRowCommand="GridView1_RowCommand">
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Width="98%" />
                        <EditRowStyle BackColor="#999999" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <Columns>
                            <asp:BoundField DataField="user_code" HeaderText="登录名" />
                            <asp:BoundField DataField="user_name" HeaderText="名称" />
                            <asp:BoundField DataField="user_type_name" HeaderText="类型" />
                            <asp:BoundField DataField="market_type_name" HeaderText="市场" />                            
                            <asp:TemplateField HeaderText="" ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButtonEdit" runat="server" CausesValidation="False" Text="修改"
                                        CommandArgument='<%# Eval("user_id") %>' CommandName="command_edit"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButtonSetVisibleLensOrder" runat="server" CausesValidation="False"
                                        Text="删除" CommandArgument='<%# Eval("user_id") %>' CommandName="command_del"
                                        OnClientClick="javascript:return delConfirm();"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="allow_login" HeaderText="允许登录" ItemStyle-HorizontalAlign="Center" />
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButtonSetVisible" runat="server" CausesValidation="False"
                                        Text="改变" CommandArgument='<%# Eval("user_id") %>' CommandName="command_allow"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    &nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="LinkButtonAdd" runat="server" CausesValidation="False"
                        Text="新增" OnClick="LinkButtonAdd_Click"></asp:LinkButton>
                </td>
                <td align="left" valign="top">
                    <asp:Panel ID="PanelInput" runat="server">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <asp:Label ID="LabelID" runat="server" Visible="true"></asp:Label>
                            <asp:TextBox ID="TextBoxCommandType" runat="server" Visible="false"></asp:TextBox>
                            <tr>
                                <td width="50">
                                    登录名:</td>
                                <td>
                                    <asp:Label ID="LabelUserCode" runat="server" Text="" Enabled="false"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    名称:</td>
                                <td>
                                    <asp:TextBox ID="TextBoxName" runat="server" CssClass="input"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                                        ControlToValidate="TextBoxName" /></td>
                            </tr>
                            <tr>
                                <td>
                                    密码:</td>
                                <td>
                                    <asp:TextBox ID="TextBoxPassword" runat="server" CssClass="input" MaxLength="10"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*"
                                        ControlToValidate="TextBoxPassword" /></td>
                            </tr>
                            <tr>
                                <td>
                                    类型:</td>
                                <td>
                                    <asp:DropDownList ID="DropDownListType" runat="server">
                                        <asp:ListItem Value="1">后台管理</asp:ListItem>
                                        <asp:ListItem Value="2">销售代表</asp:ListItem>
                                    </asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td>
                                    市场:</td>
                                <td>
                                    <asp:DropDownList ID="DropDownListMarketType" runat="server">
                                        <asp:ListItem Value="0">全部</asp:ListItem>
                                        <asp:ListItem Value="1">内销</asp:ListItem>
                                        <asp:ListItem Value="3">门市</asp:ListItem>
                                        <asp:ListItem Value="4">零配</asp:ListItem>
                                    </asp:DropDownList></td>
                            </tr>                            
                            <tr>
                                <td colspan="2">
                                    身份:
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <asp:CheckBox ID="CheckBoxDegree1" runat="server" />镜片经手人
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    权限:
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                <div style="float:left">
                                门店后台系统
                                    <asp:TreeView ID="TreeView1" runat="server" ImageSet="Arrows" ExpandDepth="0" ShowLines="true"
                                        ShowCheckBoxes="All">                                        
                                        <NodeStyle ForeColor="#008000"/>
                                    </asp:TreeView></div>
                                    <div style="float:left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                    <div style="float:left">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" align="right">
                                    <asp:Button ID="ButtonSubmit" runat="server" OnClick="ButtonSubmit_Click" Text="保存"
                                        CssClass="button" /></td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
        </table>
        </div>
    </form>
</body>
</html>
